<?php

use Biz\model\activity\SNJActivityRecord;

/**
 * @deprecated
 * 三棱镜 广告活动记录
 * Class SNJRecordAction
 */
class GetSNJInfoAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_REGISTER;

    public function main()
    {
        //  $this->uid = 55010;
        $type = $this->getRequest()->getPost('type', SNJActivityRecord::NORMAL_TYPE);
        $data = [];
        $info = SNJActivityRecord::getRecordByCondition(['uid' => $this->uid, 'type' => $type, 'ORDER' => ['id' => 'DESC']]);
        if ($info && is_array($info)) {
            $data['uid'] = $info['uid'];
            $extend_info = json_decode($info['extend_info'], true);
            $data = array_merge($data, $extend_info);
        }
        $this->setSuccess($data);

    }
}